home *** CD-ROM | disk | FTP | other *** search
- package sun.tools.tree;
-
- import java.util.Hashtable;
- import sun.tools.asm.Assembler;
- import sun.tools.java.ClassDeclaration;
- import sun.tools.java.Constants;
- import sun.tools.java.Environment;
- import sun.tools.java.Type;
-
- public class SuperExpression extends Expression {
- LocalField field;
-
- public SuperExpression(int var1) {
- super(83, var1, Type.tObject);
- }
-
- public long checkValue(Environment var1, Context var2, long var3, Hashtable var5) {
- ClassDeclaration var6 = var2.field.getClassDefinition().getSuperClass();
- if (!var2.field.isStatic() && !var2.field.isVariable() && var6 != null) {
- if ((var3 & 1L) == 0L) {
- var1.error(super.where, "access.inst.before.super", Constants.idSuper);
- super.type = Type.tError;
- return var3;
- } else {
- super.type = var6.getType();
- this.field = var2.getLocalField(Constants.idThis);
- ++this.field.readcount;
- return var3;
- }
- } else {
- var1.error(super.where, "undef.var", Constants.idSuper);
- super.type = Type.tError;
- return var3;
- }
- }
-
- public Expression inlinevalue(Environment var1, Context var2) {
- if (this.field == null) {
- return this;
- } else if (this.field != null) {
- Expression var3 = (Expression)this.field.getValue(var1);
- return (Expression)(var3 != null ? var3 : this);
- } else {
- return this;
- }
- }
-
- public void codeValue(Environment var1, Context var2, Assembler var3) {
- var3.add(super.where, 25, new Integer(this.field.number));
- }
- }
-